def avg_count():
    avg = 0
    total = 0
    count = 0

    while True:

        res = yield avg
        print(count)
        count += 1
        total += res
        avg = total/count
        print("第{}次".format(count), avg)

f= avg_count()
next(f)
f.send(11)
f.send(12)